package org.jeecg.modules.communityDynamicManag.mapper;

import java.util.List;

import com.baomidou.mybatisplus.annotation.SqlParser;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.communityDynamicManag.entity.ClubDynamicsLikesEntity;
import org.jeecg.modules.communityDynamicManag.entity.ClubDynamicsLikesEntityResult;
import org.jeecg.modules.communityDynamicManag.entity.CommunityDynamicManag;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.communityDynamicManag.entity.CommunityDynamicManagResult;
import org.jeecg.modules.communityInfluence.entity.CommunityInfluence;
import org.jeecg.modules.ruleOfInfluence.entity.RuleOfInfluence;

/**
 * @Description: 社团动态管理
 * @Author: jeecg-boot
 * @Date:   2020-07-21
 * @Version: V1.0
 */
public interface CommunityDynamicManagMapper extends BaseMapper<CommunityDynamicManag> {

    /**
     * 分页查询
     * @param communityDynamicManag
     * @return
     */
    List<CommunityDynamicManagResult> getPageList(CommunityDynamicManagResult communityDynamicManag);

    /**
     * 根据ID删除
     * @param id
     */
    void removeById(String id);

    /**
     * 判断当前用户是否已经点赞
     * @param form
     * @return
     */
    int selById(ClubDynamicsLikesEntity form);

    /**
     * 取消赞
     * @param form
     */
    void delById(ClubDynamicsLikesEntity form);

    /**
     * 点赞保存
     * @param form
     */
    void save(ClubDynamicsLikesEntity form);

    /**
     * 获取用户点赞列表，分页查询
     * @return
     */
    List<ClubDynamicsLikesEntityResult> getLikesUser();

    /**
     * 动态审核
     * @param form
     * @return
     */
    Boolean dynamicReview(CommunityDynamicManag form);

    /**
     * 获取社团影响力规则
     * @return
     */
    RuleOfInfluence getRuleOfInfluence();

    /**
     * 根据ID查询社团影响力
     * @param communityId
     * @return
     */
    CommunityInfluence getInfluenceInfo(String communityId);

    /**
     * 获取发布社团动态总共获取了多少影响力
     * @param communityId
     * @param dateTime
     * @return
     */
    Integer getMostDayDynamic(@Param("communityId") String communityId, @Param("dateTime") String dateTime);

    /**
     * 更新社团影响力
     * @param communityInfluence
     */
    Boolean updateInfluence(CommunityInfluence communityInfluence);

    /**
     * 查询当天以发布了多少挑动态
     * @param form
     * @return
     */
    @SqlParser(filter = true)
    Integer getMostDayDynamic(CommunityDynamicManagResult form);

    /**
     * 更新社团等级
     * @param level
     */
    void updateLevel(String level);
}
